﻿--================================================================================================
--                                 Change History
--                                 --------------
-- Date          Who     Description
-- -----------   ------  --------------------------------------------------
-- 06/Feb/2024   AndyB   New SystemSetting: WebPlusSkillsDisplay - controls whether Skills is Displayed
-- 06/Feb/2024   AndyB   New SystemSetting: WebPlusMaxAllowedStudentsGrid - controls how many Students (enrolments) are displayed
-- 10/Jun/2024   AndyG   New SystemSetting: OneGradePlus Root URL
-- 10/Jun/2024   AndyB   New SystemSetting: WebPlusSkillsWhoCanRecordAnswers - controls Who Can record Skills Answers? (STAFF, STUDENT, BOTH)
--
--------------------------------------------------------------------------------------------------
--select * from SystemSettingValue
--select * from SystemSettingFlag
--------------------------------------------------------------------------------------------------

-- SystemSettingFlag: Skills - Show Skills by Default
--IF NOT EXISTS (SELECT 1 FROM SystemSettingFlag WHERE SettingName = 'Show Skills By Default (in WebPlus)')
--BEGIN
--	INSERT INTO	
--		SystemSettingFlag
--			(ID, SettingName, Value, Category)
--	VALUES
--		((SELECT MAX(ID)+1 FROM SystemSettingFlag), 'Show Skills By Default (in WebPlus)', 1, 'WebPlus')
--END

-- SystemSettingValue: Maximum number of Students allowed on the main Grids
IF NOT EXISTS (SELECT 1 FROM SystemSettingValue WHERE SystemSettingName = 'WebPlusMaxAllowedStudentsGrid')
BEGIN
	INSERT INTO	
		SystemSettingValue
			(SystemSettingID, SystemSettingName, SystemSettingDescription, DataType, DefaultValue, SystemSettingValue, SystemSettingCategoryID)
	VALUES
		(7, 'WebPlusMaxAllowedStudentsGrid', 'Maximum number of Students allowed on the main Grids', 'System.Int', '2000', '2000', 1)
END

-- SystemSettingValue: Maximum number of Students allowed on the main Grids
IF NOT EXISTS (SELECT 1 FROM SystemSettingValue WHERE SystemSettingName = 'WebPlusSkillsDisplay')
BEGIN
	INSERT INTO	
		SystemSettingValue
			(SystemSettingID, SystemSettingName, SystemSettingDescription, DataType, DefaultValue, SystemSettingValue, SystemSettingCategoryID)
	VALUES
		(8, 'WebPlusSkillsDisplay', 'Controls the Skills functionality: SHOW=Show Skills Tab  HIDE=Hide Skills Tab', 'System.String', 'SHOW', 'SHOW', 1)
END


-- SystemSettingValue: Colour of the Top panel
IF NOT EXISTS (SELECT 1 FROM SystemSettingValue WHERE SystemSettingName = 'WebPlusTopPanelColour')
BEGIN
	INSERT INTO	
		SystemSettingValue
			(SystemSettingID, SystemSettingName, SystemSettingDescription, DataType, DefaultValue, SystemSettingValue, SystemSettingCategoryID)
	VALUES
		(9, 'WebPlusTopPanelColour', 'Controls the Colour of the Top panel (to be used to distinguish sandpit environments)', 'System.String', '#EDEDED', '#EDEDED', 1)
END


-- SystemSettingValue: Label on Skills Student QandA Button
IF NOT EXISTS (SELECT 1 FROM SystemSettingValue WHERE SystemSettingName = 'WebPlusSkillsStudentQandAButton')
BEGIN
	INSERT INTO	
		SystemSettingValue
			(SystemSettingID, SystemSettingName, SystemSettingDescription, DataType, DefaultValue, SystemSettingValue, SystemSettingCategoryID)
	VALUES
		(10, 'WebPlusSkillsStudentQandAButton', 'Label on Skills Student QandA Button', 'System.String', 'Answer your Questions', 'Answer your Questions', 1)
END

-- SystemSettingValue: The root of the OneGradePlus Website
IF NOT EXISTS (SELECT 1 FROM SystemSettingValue WHERE SystemSettingName = 'OneGradePlus Root URL')
BEGIN
	INSERT INTO	
		SystemSettingValue
			(SystemSettingID, SystemSettingName, SystemSettingDescription, DataType, DefaultValue, SystemSettingValue, SystemSettingCategoryID)
	VALUES
		((SELECT MAX(SystemSettingID)+1 FROM SystemSettingValue), 'OneGradePlus Root URL', 'The root of the OneGradePlus Website', 'System.String', 'http://ServerName/OneGradePlus', 'http://ServerName/OneGradePlus', 1)
END

-- SystemSettingValue: Who Can record Skills Answers?
IF NOT EXISTS (SELECT 1 FROM SystemSettingValue WHERE SystemSettingName = 'WebPlusSkillsWhoCanRecordAnswers')
BEGIN
	INSERT INTO	
		SystemSettingValue
			(SystemSettingID, SystemSettingName, SystemSettingDescription, DataType, DefaultValue, SystemSettingValue, SystemSettingCategoryID)
	VALUES
		((SELECT MAX(SystemSettingID)+1 FROM SystemSettingValue), 'WebPlusSkillsWhoCanRecordAnswers', 'Who Can record Skills Answers? (STAFF, STUDENT, BOTH)', 'System.String', 'BOTH', 'BOTH', 1)
END

